package com.zto.sch.base.normal;

import com.zto.sch.base.util.JsonUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2020-12-13 18:48
 **/
public class MapToClass {
    public static void main(String[] args) {
        Map<String, Object> map = new HashMap<>();
        map.put("age", 21);
        map.put("name","xiaoming");
        Person person = JsonUtil.parse(JsonUtil.toJSON(map), Person.class);
        System.out.println(person);



    }
}
